import http from "@/utils/requset";

// 上传图片
export const uploadFile = (formData: FormData) => {
  return http.post<{ url: string }, FormData>("/upload/", formData, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

// 上传切片
export const uploadSlice = (formData: FormData) => {
  // console.log('uploadSlice', formData)
  return http.post<any, FormData>("/upload/slice", formData, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}
// 合并切片
export const mergeSlice = (data: { filename: string; type: string }) => {
  return http.post<{ url: string }, { filename: string; type: string }>(
    "/upload/merge",
    data
  );
};